Contents | Index | < Browse | Browse >

LETTERofstreamULETTER A class for file output operations.

Overview
#include <iostream.h>

class ofstream : public ostream {
public:
ofstream();
ofstream(const char *, int = ios::out);
virtual ~ofstream();
void open(const char *, int = ios::out);
void close();
void setbuf(char *, size_t);
filebuf *rdbuf();
};

Portability
AT&T Release 2 streams library

Description
The "ofstream" class provides an output stream for files. It uses the filebuf class as streambuf.

Constructors
ofstream::ofstream();
Initializes an object without opening a file.

ofstream::ofstream(const char *, int);
Initializes an object and opens the specified file.

Deconstructors
ofstream::~ofstream();
Closes the file if it is open.

Methods
void open(const char *, int);
Opens the file with the specified name and mode.

void close();
Closes the file.

filebuf *rdbuf();
Returns a pointer to the file puffer used.

See also
ostream , fstream , ifstream , filebuf